﻿//  --------------------------------
//  Copyright (c) AW Systems, Inc. All rights reserved.
//  This source code is made available under the terms of the Microsoft Public License (Ms-PL)
//  http://www.codeplex.com/SLAM/license
//  ---------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AWS.SLAM.Configuration
{
	/// <summary>
	/// Represents an association field configured for a type managed by SLAM that maps to a column in a SQL database table or connector table.
	/// </summary>
	public class SqlMappedAssociationField : AssociationField
	{
		/// <summary>
		/// Name of the database table column for the ID column of the first associated type as defined by this field's type.
		/// </summary>
		public string FirstAssociatedTypeIdColumn { get; set; }

		/// <summary>
		/// Name of the source database table column for the ID column of the first associated type as defined by this field's type.
		/// </summary>
		public string FirstAssociatedTypeIdSourceColumn { get; set; }

		/// <summary>
		/// Name of the database table name that contributes the first associated type as defined by this field's type.
		/// </summary>
		public string FirstAssociatedTypeTableName { get; set; }

		/// <summary>
		/// The SQL datatype for the ID column of the first associated type as defined by this field's type.
		/// </summary>
		public string FirstAssociatedTypeIdSqlType { get; set; }

		/// <summary>
		/// Name of the database table column for the ID column of the second associated type as defined in AssociatedTypeName.
		/// </summary>
		public string SecondAssociatedTypeIdColumn { get; set; }

		/// <summary>
		/// Name of the source database table column for the ID column of the second associated type as defined in AssociatedTypeName.
		/// </summary>
		public string SecondAssociatedTypeIdSourceColumn { get; set; }

		/// <summary>
		/// Name of the database table name that contributes the first associated type as defined in AssociatedTypeName.
		/// </summary>
		public string SecondAssociatedTypeTableName { get; set; }

		/// <summary>
		/// The SQL datatype for the ID column of the second associated type as defined in AssociatedTypeName.
		/// </summary>
		public string SecondAssociatedTypeIdSqlType { get; set; }

		// <summary>
		/// Creates a new SqlMappedAssociationField instance.
		/// </summary>
		public SqlMappedAssociationField() { }

		/// <summary>
		/// Creates a new SqlMappedAssociationField instance with the given Name.
		/// </summary>
		/// <param name="name">The Name of the new field.</param>
		public SqlMappedAssociationField(string name)
		{
			this.Name = name;
		}
	}
}
